(abort "This installer script needs to use the ARexx utility rx.\n\nPlease make sure the rx utility is installed in sys:rexxc and try to install again."))
; make sure we have the library that EditTextFile.rexx needs
(if (not (exists "libs:rexxsupport.library"))
(abort "This installer script needs rexxsupport.library in LIBS: to run.\n\nPlease install this library and then run this Installer script again."))
; try and make sure ARexx is running
(run "rexxmast" (safe))
; if AmiPhoned is already in /serv, probably they've already installed before
(help "To send speech with AmiPhone, you need an audio digitizer connected to your parallel port. Although it often isn't necessary, AmiPhone likes to know what digitizer it is using. If your digitizer model is not listed, please choose the Generic option.")
)
)
(select Digitizer
(set Digitizer "DSS8")
(set Digitizer "PERFECTSOUND")
(set Digitizer "AMAS")
(set Digitizer "TOCCATA")
(set Digitizer "SOUNDMAGIC")
(set Digitizer "GENERIC")
)
(tooltype
(dest "AmiPhone")
(settooltype "SAMPLER" Digitizer)
)
; do they want to set up AmiPhone to receive voice-mail?
(if (= 1 (askbool
(prompt "\n\nDo you wish to set up AmiPhone to receive voice mail?")
(help "AmiPhone is capable of receiving and storing voice messages while you are away from your computer. This takes some disk space though, so if you're tight on space, you might want to leave it disabled.")
(default 0)
(choices "Yes" "No")))
; answered yes
(
(set MessageDir
(askdir
(prompt "What directory would you like AmiPhone to keep the voice message files in? (NOTE: You should not keep any other files in this directory!)")
(help @askdir-help)
(default "work:")))
(set MaxDirSize
(asknumber
(prompt "\n\nWhat should be the maximum possible size (in kilobytes) of this directory be? (Enter -1 for unlimited size)")
(help "By setting this value, you can guarantee that AmiPhoned will not let anyone fill up your hard drive. AmiPhoned counts the bytes in the voice mail directory on startup, and will reject messages if the directory size has reached the size you specify here.")
(default 500)
(range -1 1000000)))
; if a max size was set for the dir, use that as the max max file size as well
(if (> MaxDirSize -1)
(set MaxFileSize MaxDirSize)
(set MaxFileSize 1000000))
(set MaxFileSize
(asknumber
(prompt "\n\nWhat should the maximum possible size (in kilobytes) of each message be? (Enter -1 to impose no special limit on individual message size)")
(help "By setting this value, you can guarantee that no one message will fill up your entire allotment of message space.")
(default 100)
(range -1 MaxFileSize)))
(set AwayVar
(askstring
(prompt "\n\nAmiPhone uses the presence of an ENV: var to determine whether or not you're away. If the ENV: var is present, it takes a message, otherwise it puts up a requester for you. What ENV: var would you like AmiPhone to look for?")
(help "The ENV: var can be set manually by you, by a script, or often by your screen blanker. Garshneblanker, for one, sets the ENV: var named BLANKED whenever the screen blanker is active.")
(prompt "If you plan to be running AmiPhone in conjunction with AmiTCP, the line:\n\nAmiPhone 2956/tcp\n\nneeds to be present in your amitcp:db/services file. Do you wish me to update the file? (Note: AmiPhone will not receive connections if this line is not precisely as shown above!)")
(help "The inclusion of this line into amitcp:db/services is done by an ARexx script which is smart enough to correctly edit previous installations. Also it will make a backup (to amitcp:db/services.bak) before writing.")
(prompt "\nAlso, the line:\n\nAmiPhone stream tcp nowait root amitcp:serv/AmiPhoned\n\nneeds to be present in your amitcp:db/inetd.conf file. Do you wish me to update that file?\n(Note: AmiPhone will not receive connections if this line is not precisely as shown above!)")
(help "The inclusion of this line into amitcp:db/inetd.conf is done by an ARexx script which is smart enough to correctly edit previous installations. Also it will make a backup (to amitcp:db/inetd.conf.bak) before writing.")
(confirm)
)
; make sure HOSTNAME is set; if not, warn the user
(if (not (exists "env:HOSTNAME"))
(
(if (= 1 (askbool
(prompt "\n\nThe ENV variable HOSTNAME does not appear to be set on your system. AmiPhone needs this ENV variable to run correctly. Would you like to set it now?")
(help "If you know the Internet Host name of your Amiga, select 'Enter HOSTNAME Now' and type it in. Your HOSTNAME should be something like mycomputer.mynetwork.mydomain (ex: sdcc8.ucsd.edu) The string you type will be saved to the files env:HOSTNAME and envarc:HOSTNAME.")
(default 1)
(choices "Enter HOSTNAME now" "Skip This Part")
)
)
(
(set HostName (askstring
(prompt "Please enter your HOSTNAME in the box below. You HOSTNAME should be something like mycomputer.mysystem.mydomain (for example, sdcc8.ucsd.edu)")
(help @askstring-help)
)
)
(if (= 0 (strlen HostName))
(message "You entered an empty HOSTNAME string. I'll assume that you wished to skip this part.")
(
; just in case, delete so that we can't ever have two lines in var
(delete "env:HOSTNAME")
(delete "envarc:HOSTNAME")
(textfile
(dest "ENV:HOSTNAME")
(append HostName)
)
(textfile
(dest "ENVARC:HOSTNAME")
(append HostName)
)
)
)
)
)
)
)
(message "\n\nAmiPhone is now installed.\nRe-start AmiTCP and try it out!")
)
(abort "\n\nAmiTCP does not appear to be set up on your system. (Specifically, the assign AmiTCP: has not been made) Because of this, I am unable to install AmiPhone. Please install AmiTCP and then try again.")